import logging
import time
from UI_web_wms.base import Base
from selenium.webdriver.common.by import By
from selenium import webdriver

class Page(Base):

    #进入框架
    frame_loc=(By.XPATH,'/html/body/div[3]/div[3]/div[1]/div/div[3]/div[1]/div[2]/iframe')
    def kj(self):
        self.frame(self.frame_loc)

    #输入账号密码
    user_loc=(By.NAME,'email')
    def username(self):
        self.send_keys(self.user_loc,'15712990423')
    mise=(By.NAME,'password')
    def password(self):
        self.send_keys(self.mise,'Zl20040205')
    # 点击登录
    denglu=(By.XPATH,'//*[@id="dologin"]')
    def denglu_loc(self):
        self.click(self.denglu)






    def login_163_luoji(self):
        self.open_url('https://mail.163.com/')
        logging.info("开始登录")
        self.kj()
        self.username()
        self.password()
        self.denglu_loc()
        logging.info('登录结束')



